<!-- Contents for Admin Views -->

<!-- Manage User Tab -->

<div id="manageUser">
        <!-- Add Form Div -->

        <div class="form">
            <!-- Link to Expand Form --><span id="addUserLink"
                 onclick=
                 "ECForm('addUserForm','addUserLink', 'Click Here to Add New User');"><img src="img/details_open.png"
                 alt="Add User" />Click Here to Add New User.</span>

            <div id="addUserForm"
                 class="hiddenForm">
                <p>Add User:</p>

                <form id="addUser"
                      name="addUser"
                      action="/add/user"
                      method="post">
                    <!-- Username -->

                    <div class="element">
                        <label>Username:</label> <input type='text'
                             id='username'
                             name='username' /> 
                             <!-- Hidden Error Message for invalid username -->
                             <span id="musername"
                             class="hiddenMessage err">Please Enter a Username for
                             this user.</span>
                    </div><!-- Password -->

                    <div class="element">
                        <label>Password:</label> <input type='password'
                             id='password'
                             name='password' /> 
                             <!-- Hidden Error Message for invalid password -->
                             <span id="mpwd"
                             class="hiddenMessage err">Please Enter a password for
                             this user.</span>
                    </div><!-- First Name -->

                    <div class="element">
                        <label>First Name:</label> <input type='text'
                             id='fName'
                             name='fName' /> 
                             <!-- Hidden Error Message for invalid first name -->
                             <span id="mfName"
                             class="hiddenMessage err">Please Enter User First
                             Name.</span>
                    </div><!-- Last Name -->

                    <div class="element">
                        <label>Last Name:</label> <input type='text'
                             id='lName'
                             name='lName' /> 
                             <!-- Hidden Error Message for invalid last name -->
                             <span id="mlName"
                             class="hiddenMessage err">Please Enter User Last
                             Name.</span>
                    </div><!-- User Type i.g. client, admin, courier, etc -->

                    <div class="element">
                        <label>User Type</label> <select id="cType"
                             name="cType">
                            <!-- TODO Remove static options. -->

                            <option selected="selected"
                                    value="-1">
                                Select User Type
                            </option>
                        </select> 
                        <!-- Hidden Error Message for invalid user type selected. -->
                        <span id="mtype"
                             class="hiddenMessage err">Please Select User
                             Type.</span>
                    </div><!-- Client Site -->

                    <div class="element">
                        <label>Client Site:</label> <select id="siteId"
                             name="siteId">
                            <!-- TODO Remove static options. -->

                            <option selected="selected"
                                    value="-1">
                                Select Site
                            </option>
                        </select> 
                        <!-- Hidden Error Message for invalid Client Site selected. -->
                        <span id="mSiteID"
                             class="hiddenMessage err">Please Select a Site
                             Location.</span>
                    </div><!-- Submit Button -->

                    <div class="element">
                        <p><span id="mUserAddMessage"
                              class="hiddenMessage"></span></p><input type=
                              "button"
                             name="submitUser"
                             value="Add User"
                             onclick="addNewUser()" />
                    </div>
                </form>
            </div>
        </div><!-- Table displaying User.-->

        <div class='table'>
            <table cellpadding="0"
                   cellspacing="0"
                   border="0"
                   class="display"
                   id="userTable">
                <thead>
                    <tr>
                        <th>User ID</th>

                        <th>First Name</th>

                        <th>Last Name</th>

                        <th>User Type</th>

                        <th>Hospital</th>
                    </tr>
                </thead>

                <tbody id="userTableBody"
                       class="generalData"></tbody>
            </table>
        </div>
    </div><!-- End of Manage User Tab --><!-- Being of Manage Route View -->

    <div id="manageRoute">
        <!--Manage Route Form Div-->

        <div class="form">
            <p><span id="mRoutePass"
                  name="mRoutePass"
                  class="hiddenMessage pass">Checklist has been added
                  Successfully</span></p>

            <p><span id="addRouteLink"
                  onclick=
                  "ECForm('addRouteForm','addRouteLink', 'Add New Route');"><img src="img/details_open.png"
                 alt="Open" />Add New Route</span></p>
                 <!--Hide and unhide this div to display/set invisiable the form.-->

            <div id="addRouteForm"
                 class="hiddenForm">
                <form id="addRoute"
                      name="addRoute"
                      action="/add/route"
                      method="post">
                    <!-- Courier to set Route  -->

                    <div class="element">
                        <label>Courier Name:</label> 
                        <select
                             id='rName'
                             name='rName'>
                            <option selected="selected"
                                    value="-1">
                                Select a courier
                            </option><!-- Insert Courier Route here -->
                        </select> 
                        <!-- Hidden Error Message for invalid courier selected -->
                        <span id="mRName"
                             name="mRName"
                             class='hiddenMessage err'>Please Enter a Courier
                             for this Route.</span>
                    </div>
                    <!-- Div for adding individual destination point to courier route  -->

                    <div class="form">
                             <!-- Hidden Error Message for invalid destination point -->
                             <span id="minPointErr"
                             name="minPointErr"
                             class="hiddenMessage err">You are required to have
                             at least one point within a route.</span>

                        
                            <div class="element">
                                <label>Add Destination Points:</label>

                                <p><select type='text'
                                        id='pointD'
                                        name='pointD' onchange="addPoint()">
                                    <option selected='selected'
                                            value="-1">
                                        Select A Destination Point
                                    </option><!-- Insert Courier Route here -->
                                </select></p>
                                <!-- Hidden Error Message for invalid Destination Point. --><span id="mPointDescription"
                                     name="mPointDescription"
                                     class='hiddenMessage err'>Please Enter a
                                     Description for this Point.</span>
                            </div><!-- Add Destination Point Button -->

                            <div class="element">
                                <!-- Hidden Success Message for adding destination point to system. -->

                                <p><span id="addPointPass"
                                      name="addPointPass"
                                      class="hiddenMessage pass">Point has been
                                      added to route.</span> 
                                      <!-- Hidden Error Message for adding destination point to the system. -->
                                      <span id="addPointFail"
                                      name="addPointFail"
                                      class="hiddenMessage err">Some error
                                      occured while trying to add this point to
                                      the route. Please try again.</span></p>

                            </div>
                    </div>

                    <div class="hiddenForm">
                        <label>Points:</label> 
                        <textarea id='points'
                             name='points'
                             cols="100"
                             rows="10">
</textarea>

                        <textarea id='pointsText'
                             name='pointsText'
                             cols="100"
                             rows="10">
</textarea>
                    </div>
                    <!-- Table Displaying Destination points that has been added to the user. -->


                        <div class='table'>
                            <table cellpadding="0"
                                   cellspacing="0"
                                   border="0"
                                   id="pointsTable"
                                   class="hiddenTable display">
                                <thead>
                                    <tr>
                                        <th>Checklist</th>
                                    </tr>
                                </thead>

                                <tbody id="pointsTableBody"></tbody>
                            </table>
                        </div>



                    <div class="element">
                        <!-- Hidden Error Message for adding route to the system -->

                        <p><span id="mRouteFail"
                              name="mRouteFail"
                              class="hiddenMessage err">An Error Occured While
                              Trying to Add this Route to the
                              System</span></p><input type="button"
                             name="addRouteButton"
                             onclick="addNewRoute()"
                             value="Add Route" />
                    </div>
                </form>
            </div>
        </div><!-- Table Displaying Route Data within system -->

        <div class='table'>
            <table cellpadding="0"
                   cellspacing="0"
                   border="0"
                   class="display"
                   id="routeTable">
                <thead>
                    <tr>
                        <th>Courier Username</th>
                        <th>Route</th>
                    </tr>
                </thead>

                <tbody id="routeTableBody"></tbody>
            </table>
        </div>
    </div><!-- End of Manage Route View -->
    <!-- Being of Manage Checklist View -->

    <div id="manageChecklist">
        <div class="form">
            <!-- Hidden Success Message for Adding Checklist to data -->

            <p><span id="mCheckListPass"
                  name="mCheckListPass"
                  class="hiddenMessage pass">Checklist has been added
                  Successfully</span></p>
                  <!-- Link to expand checklist add form. -->

            <p><span id="addCheckListLink"
                  onclick=
                  "ECForm('addCheckListForm','addCheckListLink', 'Add New Checklist');">
            <img src="img/details_open.png"
                 alt="Open" />Add New Checklist</span></p>
                 <!-- Add Checklist form -->

            <div id="addCheckListForm"
                 class="hiddenForm">
                <form id="addCheckList"
                      name="addCheckList"
                      action=""
                      >
                    <!-- Checklist Name -->

                    <div class="element">
                        <label>List Name:</label> 
                        <select
                             id='clName'
                             name='clName'>
                             <option selected="selected" value="-1">
                             Select Checklist</option>
                             <option value="0">Starting Checklist</option>
                             <option value="1">Ending Checklist</option>
                             </select>
                              
                             <!-- Hidden Error Message for invalid checklist name -->
                             <span id="mListName"
                             name="mListName"
                             class='hiddenMessage err'>Please Enter a Name for
                             this List.</span>
                    </div>
                    <!-- Expandable form to add new "step" item to checklist. -->

                    <div class="form">
                             <!-- Hidden Error Message for invalid number of item in checklist -->
                             <span id="minStepErr"
                             name="minStepErr"
                             class="hiddenMessage err">You are required to have
                             at least one step within a checklist.</span>

                        <div id="addStepItemForm">
                            <p>
                            <!-- Description for each step (or event) for checklist --></p>

                            <div class="element">
                                <label>Step Description:</label>

                                <p>
                                <textarea name="stepD"
                                          cols="40"
                                          rows="10">
</textarea></p>
                                <!-- Hidden Error Message for invalid step/event --><span id="mStepDescription"
                                     name="mStepDescription"
                                     class='hiddenMessage err'>Please Enter a
                                     Description for this Step.</span>
                            </div>

                            <div class="element">
                                <!-- Hidden Success Message for adding step to the checklist -->

                                <p><span id="addStepPass"
                                      name="addStepPass"
                                      class="hiddenMessage pass">Step has been
                                      added to checklist.</span> 
                                      <!-- Hidden Error Message for adding step to the checklist -->
                                      <span id="addStepFail"
                                      name="addStepFail"
                                      class="hiddenMessage err">Some error
                                      occured while trying to add this step to
                                      the checklist. Please try again.</span></p>
                                      <!-- Add Button to add step to checklist -->

                                <p><input type="button"
                                       value="Add Step"
                                       onclick="addStep();" /></p>
                            </div>
                        </div>
                    </div><!-- Hidden field to store checklist string -->

                    <div class="hiddenForm">
                        <label>Checklist:</label> 
                        <textarea id='checkList'
                             name='checkList'
                             cols="60"
                             rows="5">
</textarea>

                    </div>
                    <!-- Table to display all steps/events that have been added to checklist -->

                        <div class='table'>
                            <table cellpadding="0"
                                   cellspacing="0"
                                   border="0"
                                   id="stepsTable"
                                   class="hiddenTable display">
                                <thead>
                                    <tr>
                                        <th>Checklist</th>
                                    </tr>
                                </thead>

                                <tbody id="stepsTableBody"></tbody>
                            </table>
                        </div>
                    <!-- Field for any comment regarding this checklist -->



                    <div class="element">
                        <!-- Hidden Error Message for adding checklist to system -->

                        <p><span id="mCheckListFail"
                              name="mCheckListFail"
                              class="hiddenMessage err">An Error Occured While
                              Trying to Add this Checklist to the
                              System</span></p><input type="button"
                             name="addCheclistButton"
                             onclick="addNewCheckList()"
                             value="Add CheckList" />
                    </div>
                </form>
            </div>
        </div>
		<p><span class="h1">Starting Checklist</span></p>
        <div class='table'>
            <!-- Table to display all availiable checklists. -->

            <table cellpadding="0"
                   cellspacing="0"
                   border="0"
                   class="display"
                   id="sCheckListTable">
                <thead>
                    <tr>
                        <th>Descriptions</th>

                    </tr>
                </thead>

                <tbody id="sCheckListTableBody"></tbody>
            </table>
        </div>
        <p><span class="h1">Ending Checklist</span></p>
        <div class='table'>
            <!-- Table to display all availiable checklists. -->

            <table cellpadding="0"
                   cellspacing="0"
                   border="0"
                   class="display"
                   id="eCheckListTable">
                <thead>
                    <tr>
                        <th>Descriptions</th>

                    </tr>
                </thead>

                <tbody id="eCheckListTableBody"></tbody>
            </table>
        </div>
    </div><!-- End of Manage Checklist View -->
  

<div id="manageClientSite">
	<div class="form">
   		<form id="addClientSite"
        	name="addClientSite"
            action="/add/clientsite"
            method="post">
            
            <!-- ClientSite Name -->
            <div class="element">
            	<label>Client Site Name:</label>
                <input type="text" id="siteName" name="siteName" />
                <span id="mSiteName" name="mSiteName"
                	class="hiddenMessage err">Please Enter a Name for this Client Site.</span>
            </div>
            <div class="element">
            	<label>Hospital Name:</label>
                <select id="hID" name="hID">
                </select>
                <span id="mHID" name="mHID"
                	class="hiddenMessage err">Please Enter a Hospital Name.</span>
            </div>
            <div class="element">
            	<label>Phone Number:</label>
                <input type="text" id="hPhone" name="hPhone" />
                <span id="mHPhone" name="mHPhone"
                	class="hiddenMessage err">Please Enter a Phone Number for this Hospital.</span>
            </div>
            <div class="element">
            	<p><span>Instruction Checklist</span>
                <span id="mInstList" name="mInstList"class="hiddenMessage err">Your checklist is empty.</span></p>
                
                <label>Add Instruction Step:</label>
                <textarea id="instItem" name="instItem" rows="5" cols="30"></textarea>
                <span id="mInstItem" name="mInstItem"
                	class="hiddenMessage err">Please type out the instruction for his step.</span>
                <textarea type="text" id="instList" name="instList" class="hiddenTextBox" rows="5" cols="30"></textarea>
           		 <span id="addInstItemPass" name="addInstItemPass"
                	class="hiddenMessage pass">Instruction step is sucessfully added.</span>
                <p><input type="button" value="Add Step" onclick="addInstStep()" /></p>
            </div>

                        <div class='table'>
                            <table cellpadding="0"
                                   cellspacing="0"
                                   border="0"
                                   id="instTable"
                                   class="hiddenTable display">
                                <thead>
                                    <tr>
                                        <th>Checklist</th>
                                    </tr>
                                </thead>

                                <tbody id="instTableBody"></tbody>
                            </table>
                        </div>

            <div class="element">
            <span id="addClientSitePass" name="addClienSitePass"
                	class="hiddenMessage pass">Client site is sucessfully added.</span>
                    <span id="addClientSiteFail" name="addClienSiteFail"
                	class="hiddenMessage err">An error had occured while trying to add client site to the system.</span>
            	<input type="button" value="Add Client Site" onclick="addNewClientSite()" />
            </div>
            </form>
    </div>
    <div class='table'>
            <table cellpadding="0"
                   cellspacing="0"
                   border="0"
                   class="display"
                   id="clientSiteTable">
                <thead>
                    <tr>
                        <th>Site Name</th>
                        <th>Hospital Name</th>
                        <th>Phone Number</th>
                        <th>Checklist</th>
                    </tr>
                </thead>
                <tbody id="clientSiteTableBody"></tbody>
            </table>
        </div>
</div>

<div id="manageHospital">
	<div class="form">
   		<form id="addHospital"
        	name="addHospital"
            action="/add/hospital"
            method="post">
            
            <!-- Hospital Name -->
            <div class="element">
            	<label>Hospital Name:</label>
                <input type="text" id="hName" name="hName" />
                <span id="mHName" name="mHName"
                	class="hiddenMessage err">Please Enter a Name for this Hospital.</span>
            </div>
            <!-- Hospital Address -->
            <div class="element">
            	<label>Hospital Address:</label>
                <input type="text" id="hAddress" name="hAddress" />
                <span id="mHAddress" name="mHAddress"
                	class="hiddenMessage err">Please enter an address for this hospital.</span>
            </div>
            <div class="element">
            <span id="addHospitalPass" name="addHospitalPass"
                	class="hiddenMessage pass">Hospital is sucessfully added.</span>
                    <span id="addHospitalFail" name="addHospitalFail"
                	class="hiddenMessage err">An error had occured while trying to add hospital to the system.</span>
            	<input type="button" value="Add Hospital" onclick="addNewHospital()" />
            </div>
            </form>
    </div>

        <div class='table'>
            <table 
                   cellspacing="0"
                   border="0"
                   class="display"
                   id="hospitalTable">
                <thead>
                    <tr>
                        <th>Hospital Name</th>
                        <th>Address</th>
                    </tr>
                </thead>
                <tbody id="hospitalTableBody"></tbody>
            </table>
        </div>
</div>

